/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JInternalFrameSalesBill.java
 *
 * Created on Dec 4, 2011, 6:36:24 PM
 */
package callcenter;
import Database.Addministave;
import Database.Customer;
import Database.Product;
import Database.SalesBill;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.JOptionPane;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author user
 */
public class JInternalFrameSalesBill extends javax.swing.JInternalFrame {
    Vector<Customer> ctl=new Vector<Customer> (); 
    Vector<Addministave> adl=new Vector<Addministave> (); 
    Vector<Product> pdl=new Vector<Product> (); 
    Vector<SalesBill> lsbb=new Vector<SalesBill> (); 
    //private int b = Medium.jfl.Number();
    private String langue = new String();
    private String country = new String();
    private String str = new String();
    private Locale lc = null;
    private ResourceBundle rb = null;

    /** Creates new form JInternalFrameSalesBill */
    public JInternalFrameSalesBill() {
        Medium.jifs = this;
        initComponents();
        Createcb();
        Createcbad();
        Createcbpd();
       // Createcbst();
       // Creattabledatabase();
        int i=4;
       Creattabledatabase1(i);
        //jPaneldetailproduct.setVisible(false);
        //jPaneldetailsalesbill.setVisible(false);
//        jPaneldetailproduct.setEnabled(false);
//        jPaneldetailsalesbill.setEnabled(false);
        //jTabbedPane2.setEnabled(false);
    }
    public int getselectedsalesbillid()
    {
         String s=this.jTablecontent.getValueAt(jTablecontent.getSelectedRow(), 0).toString();
         int billid=Integer.valueOf(s) ;
         return billid;
         //return 0;
    }
    
    private void Creattabledatabase1(int i)
    {
        
        Vector<String> cols =new Vector<String>();
        cols.add("Bill Id");
        cols.add("Bill Name");
        cols.add("Customer");
        cols.add("Billing Person");
        cols.add("Build Date");
        cols.add("States");
        cols.add("Unit");
        cols.add("Total Cost");
        SalesBill sb=new SalesBill();
        Vector<Vector<Object>> listsalesbill1=new Vector<Vector<Object>>();
        for(int j=i-4; j<i;j++)
        {
        listsalesbill1.add( sb.Listtablesalesbill().elementAt(j));
        }
        DefaultTableModel dtb=new DefaultTableModel(listsalesbill1,cols);
        //sb.Listtablesalesbill().elementAt(i);
        //DefaultTableModel dtb=new DefaultTableModel(sb.Listtablesalesbill(),cols);
        jTablecontent.setModel(dtb);
    }
    private void Creattabledatabase2(int i)
    {
          Vector<String> cols =new Vector<String>();
        cols.add("Bill Id");
        cols.add("Bill Name");
        cols.add("Customer");
        cols.add("Billing Person");
        cols.add("Build Date");
        cols.add("States");
        cols.add("Unit");
        cols.add("Total Cost");
        SalesBill sb=new SalesBill();
        Vector<Vector<Object>> listsalesbill1=new Vector<Vector<Object>>();
        while(i<sb.geti())
        {
        listsalesbill1.add( sb.Listtablesalesbill().elementAt(i));
        i++;
        }
        DefaultTableModel dtb=new DefaultTableModel(listsalesbill1,cols);
        //sb.Listtablesalesbill().elementAt(i);
        //DefaultTableModel dtb=new DefaultTableModel(sb.Listtablesalesbill(),cols);
        jTablecontent.setModel(dtb);
    }
     private void Creattabledatabasepr(int a)
    {
          Vector<String> cols =new Vector<String>();
        cols.add("Bill Id");
        cols.add("Bill Name");
        cols.add("Customer");
        cols.add("Billing Person");
        cols.add("Build Date");
        cols.add("States");
        cols.add("Unit");
        cols.add("Total Cost");
        SalesBill sb=new SalesBill();
        Vector<Vector<Object>> listsalesbill1=new Vector<Vector<Object>>();
       for(int b=a-4;b<a;b++)
        {
        listsalesbill1.add( sb.Listtablesalesbill().elementAt(b));
        }
       
        DefaultTableModel dtb=new DefaultTableModel(listsalesbill1,cols);
         jTablecontent.setModel(dtb);
    }
    private void Creattabledatabase()
    {
        Vector<String> cols =new Vector<String>();
        cols.add("Bill Id");
        cols.add("Bill Name");
        cols.add("Customer");
        cols.add("Billing Person");
        cols.add("Build Date");
        cols.add("States");
        cols.add("Unit");
        cols.add("Total Cost");
        SalesBill sb=new SalesBill();
        DefaultTableModel dtb=new DefaultTableModel(sb.Listtablesalesbill(),cols);
        jTablecontent.setModel(dtb);
    }
     private void Creattabledatabase3()
    {
        Vector<String> cols =new Vector<String>();
        cols.add("Bill Id");
        cols.add("Bill Name");
        cols.add("Customer");
        cols.add("Billing Person");
        cols.add("Build Date");
        cols.add("States");
        cols.add("Unit");
        cols.add("Total Cost");
        SalesBill sb=new SalesBill();
        DefaultTableModel dtb=new DefaultTableModel(null,cols);
        jTablecontent.setModel(dtb);
    }
    private void Createcb()
    {
        Customer ct=new Customer();
        ctl=ct.customerlist();  
        DefaultComboBoxModel dc=new DefaultComboBoxModel();
        for(Customer ctm:ctl)
        {
            dc.addElement(ctm.getCustomername());
            jComboBoxcustomername.setModel(dc);
            
        }
        
    }
    
    private void Createcbpd()
    {
        Product pd=new Product();
        pdl=pd.Vectorproduct();
        DefaultComboBoxModel dc=new DefaultComboBoxModel();
        for(Product pdd:pdl)
        {
            dc.addElement(pdd.getProductName());
            jComboBoxProductname.setModel(dc);
            
        }
    }
    public void Createcbad()
    {
        Addministave ad=new Addministave();
        adl=ad.Addlist();
        DefaultComboBoxModel ac=new DefaultComboBoxModel();
        for(Addministave add:adl)
        {
            ac.addElement(add.getAccountname());
            jComboBoxaccount.setModel(ac);
        }
    }
    public void Createcbst()
    {
       SalesBill sb=new SalesBill();
       lsbb=sb.lissb();
       DefaultComboBoxModel dc=new DefaultComboBoxModel();
       for(SalesBill s:lsbb)
       {
           dc.addElement(s.getState());
           jComboBoxst.setModel(dc);
       }
    }
    /*
      String username=this.jTablenoidung.getValueAt(jTablenoidung.getSelectedRow(), 0).toString();
        String password=this.jTablenoidung.getValueAt(jTablenoidung.getSelectedRow(), 1).toString();
        String hoten=this.jTablenoidung.getValueAt(jTablenoidung.getSelectedRow(), 2).toString();
        String quyen=this.jTablenoidung.getValueAt(jTablenoidung.getSelectedRow(), 3).toString();
     */
    private void Tableinformation()
    {
        try{
        String billname=this.jTablecontent.getValueAt(jTablecontent.getSelectedRow(), 1).toString();
        String customername=this.jTablecontent.getValueAt(jTablecontent.getSelectedRow(), 2).toString();
        String billpersion=this.jTablecontent.getValueAt(jTablecontent.getSelectedRow(), 3).toString();
        String st=this.jTablecontent.getValueAt(jTablecontent.getSelectedRow(), 5).toString();
        String unit=this.jTablecontent.getValueAt(jTablecontent.getSelectedRow(), 6).toString();
        
        String date=this.jTablecontent.getValueAt(jTablecontent.getSelectedRow(), 4).toString(); 
        //String date="03-23-2003";
        SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
        this.jCalendarCombobuilddate.setDate(sdf.parse(date));
        
        this.jTextFieldbillname.setText(billname);
        this.jComboBoxcustomername.setSelectedItem(customername);
        this.jComboBoxaccount.setSelectedItem(billpersion);
        this.jComboBoxst.setSelectedItem(st);
        this.jComboBoxunit.setSelectedItem(unit);
        }
        catch(Exception ex)
        {
            System.out.println(ex);
        }
        // this.jComboBoxsstate.setSelectedItem(sstate);
    }
     private void Translate(String landue, String tenqg, String chuoi) {
        //callcenter/resources/JInternalFrameVender_en_US
        lc = new Locale(landue, tenqg);
        rb = ResourceBundle.getBundle("callcenter/resources/" + chuoi, lc);
        jTabbedPane1.setTitleAt(0, rb.getString("tab1"));
        jTabbedPane1.setTitleAt(1, rb.getString("tab2"));
        TitledBorder t = (TitledBorder) this.jPanel3.getBorder();
        t.setTitle(rb.getString("jPanel3.border.title"));
        jLabel1.setText(rb.getString("jLabel1.text"));
        jLabel2.setText(rb.getString("jLabel2.text"));
        jLabel3.setText(rb.getString("jLabel3.text"));
        jLabel4.setText(rb.getString("jLabel4.text"));
        jLabel5.setText(rb.getString("jLabel5.text"));
        jButton1.setText(rb.getString("jButton1.text"));
        //jButtonadd.setText(rb.getString("jButton2.text"));
        jButton3.setText(rb.getString("jButton3.text"));
        jButton4.setText(rb.getString("jButton4.text"));
        jButton5.setText(rb.getString("jButton5.text"));
        TitledBorder t1 = (TitledBorder) this.jPanel1.getBorder();
        t1.setTitle(rb.getString("jPanel1.border.title"));
        jLabel6.setText(rb.getString("jLabel6.text"));
        jLabel7.setText(rb.getString("jLabel7.text"));
        jLabel8.setText(rb.getString("jLabel8.text"));
        jLabel9.setText(rb.getString("jLabel9.text"));
        jCheckBox1.setText(rb.getString("jCheckBox1.text"));
        jCheckBox2.setText(rb.getString("jCheckBox2.text"));
        jCheckBox3.setText(rb.getString("jCheckBox3.setText"));
        TitledBorder t2 = (TitledBorder) this.jPanel4.getBorder();
        t2.setTitle(rb.getString("jPanel4.border.title"));
        
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jComboBox1 = new javax.swing.JComboBox();
        jTextField3 = new javax.swing.JTextField();
        jPanel75 = new javax.swing.JPanel();
        jPanel76 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jPaneldetail = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jPanel13 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jPanel14 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jPanel15 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jPanel16 = new javax.swing.JPanel();
        jTextFieldbillname = new javax.swing.JTextField();
        jPanel17 = new javax.swing.JPanel();
        jComboBoxcustomername = new javax.swing.JComboBox();
        jPanel18 = new javax.swing.JPanel();
        jComboBoxaccount = new javax.swing.JComboBox();
        jPanel19 = new javax.swing.JPanel();
        jCalendarCombobuilddate = new org.freixas.jcalendar.JCalendarCombo();
        jPanel20 = new javax.swing.JPanel();
        jPanel89 = new javax.swing.JPanel();
        jComboBoxst = new javax.swing.JComboBox();
        jPanel90 = new javax.swing.JPanel();
        jPanel91 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jPanel92 = new javax.swing.JPanel();
        jComboBoxunit = new javax.swing.JComboBox();
        jPanel88 = new javax.swing.JPanel();
        jComboBoxProductname = new javax.swing.JComboBox();
        jPanel21 = new javax.swing.JPanel();
        jPanel22 = new javax.swing.JPanel();
        jButton4 = new javax.swing.JButton();
        jPanel23 = new javax.swing.JPanel();
        jPanel24 = new javax.swing.JPanel();
        jButton3 = new javax.swing.JButton();
        jPanel25 = new javax.swing.JPanel();
        jPanel26 = new javax.swing.JPanel();
        jButton2 = new javax.swing.JButton();
        jPanel27 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jPanel64 = new javax.swing.JPanel();
        jPanel66 = new javax.swing.JPanel();
        jPanel67 = new javax.swing.JPanel();
        jPanel74 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jPanel68 = new javax.swing.JPanel();
        jPanel69 = new javax.swing.JPanel();
        jButton6 = new javax.swing.JButton();
        jPanel70 = new javax.swing.JPanel();
        jButton8 = new javax.swing.JButton();
        jPanel71 = new javax.swing.JPanel();
        jPanel72 = new javax.swing.JPanel();
        jButton7 = new javax.swing.JButton();
        jPanel73 = new javax.swing.JPanel();
        jTextField6 = new javax.swing.JTextField();
        jPanel65 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTablecontent = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        jPanel33 = new javax.swing.JPanel();
        jPanel35 = new javax.swing.JPanel();
        jPanel36 = new javax.swing.JPanel();
        jPanel37 = new javax.swing.JPanel();
        jPanel28 = new javax.swing.JPanel();
        jPanel31 = new javax.swing.JPanel();
        jPanel32 = new javax.swing.JPanel();
        jPanel38 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jPanel39 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jPanel40 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jPanel41 = new javax.swing.JPanel();
        jPanel42 = new javax.swing.JPanel();
        jPanel43 = new javax.swing.JPanel();
        jPanel29 = new javax.swing.JPanel();
        jPanel52 = new javax.swing.JPanel();
        jPanel53 = new javax.swing.JPanel();
        jPanel54 = new javax.swing.JPanel();
        jCheckBox1 = new javax.swing.JCheckBox();
        jPanel55 = new javax.swing.JPanel();
        jCheckBox2 = new javax.swing.JCheckBox();
        jPanel56 = new javax.swing.JPanel();
        jCheckBox3 = new javax.swing.JCheckBox();
        jPanel57 = new javax.swing.JPanel();
        jPanel58 = new javax.swing.JPanel();
        jPanel59 = new javax.swing.JPanel();
        jPanel30 = new javax.swing.JPanel();
        jPanel44 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jPanel45 = new javax.swing.JPanel();
        jPanel46 = new javax.swing.JPanel();
        jTextField4 = new javax.swing.JTextField();
        jPanel47 = new javax.swing.JPanel();
        jComboBox2 = new javax.swing.JComboBox();
        jPanel48 = new javax.swing.JPanel();
        jPanel49 = new javax.swing.JPanel();
        jPanel60 = new javax.swing.JPanel();
        jPanel61 = new javax.swing.JPanel();
        jPanel62 = new javax.swing.JPanel();
        jButton5 = new javax.swing.JButton();
        jPanel63 = new javax.swing.JPanel();
        jPanel50 = new javax.swing.JPanel();
        jPanel51 = new javax.swing.JPanel();
        jPanel34 = new javax.swing.JPanel();
        jPanel77 = new javax.swing.JPanel();
        jPanel79 = new javax.swing.JPanel();
        jPanel80 = new javax.swing.JPanel();
        jPanel87 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jPanel81 = new javax.swing.JPanel();
        jPanel82 = new javax.swing.JPanel();
        jButton9 = new javax.swing.JButton();
        jPanel83 = new javax.swing.JPanel();
        jButton11 = new javax.swing.JButton();
        jPanel84 = new javax.swing.JPanel();
        jPanel85 = new javax.swing.JPanel();
        jButton10 = new javax.swing.JButton();
        jPanel86 = new javax.swing.JPanel();
        jTextField7 = new javax.swing.JTextField();
        jPanel78 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox1.setName("jComboBox1"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(callcenter.CallcenterApp.class).getContext().getResourceMap(JInternalFrameSalesBill.class);
        jTextField3.setText(resourceMap.getString("jTextField3.text")); // NOI18N
        jTextField3.setName("jTextField3"); // NOI18N

        jPanel75.setName("jPanel75"); // NOI18N

        javax.swing.GroupLayout jPanel75Layout = new javax.swing.GroupLayout(jPanel75);
        jPanel75.setLayout(jPanel75Layout);
        jPanel75Layout.setHorizontalGroup(
            jPanel75Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel75Layout.setVerticalGroup(
            jPanel75Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        jPanel76.setName("jPanel76"); // NOI18N

        javax.swing.GroupLayout jPanel76Layout = new javax.swing.GroupLayout(jPanel76);
        jPanel76.setLayout(jPanel76Layout);
        jPanel76Layout.setHorizontalGroup(
            jPanel76Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel76Layout.setVerticalGroup(
            jPanel76Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setName("Form"); // NOI18N
        setPreferredSize(new java.awt.Dimension(970, 520));

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setLayout(new java.awt.GridLayout(2, 1, 3, 3));

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(resourceMap.getColor("jPanel3.border.border.lineColor"), 3), resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N
        jPanel3.setLayout(new java.awt.BorderLayout());

        jPaneldetail.setName("jPaneldetail"); // NOI18N
        jPaneldetail.setPreferredSize(new java.awt.Dimension(610, 216));
        jPaneldetail.setLayout(new java.awt.BorderLayout());
        jPanel3.add(jPaneldetail, java.awt.BorderLayout.LINE_END);

        jPanel7.setName("jPanel7"); // NOI18N
        jPanel7.setLayout(new java.awt.BorderLayout());

        jPanel8.setName("jPanel8"); // NOI18N
        jPanel8.setLayout(new java.awt.GridLayout(7, 1, 4, 4));

        jPanel10.setName("jPanel10"); // NOI18N
        jPanel10.setLayout(new java.awt.BorderLayout());

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N
        jPanel10.add(jLabel1, java.awt.BorderLayout.CENTER);

        jPanel8.add(jPanel10);

        jPanel11.setName("jPanel11"); // NOI18N
        jPanel11.setLayout(new java.awt.BorderLayout());

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N
        jPanel11.add(jLabel2, java.awt.BorderLayout.CENTER);

        jPanel8.add(jPanel11);

        jPanel12.setName("jPanel12"); // NOI18N
        jPanel12.setLayout(new java.awt.BorderLayout());

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N
        jPanel12.add(jLabel3, java.awt.BorderLayout.CENTER);

        jPanel8.add(jPanel12);

        jPanel13.setName("jPanel13"); // NOI18N
        jPanel13.setLayout(new java.awt.BorderLayout());

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N
        jPanel13.add(jLabel4, java.awt.BorderLayout.CENTER);

        jPanel8.add(jPanel13);

        jPanel14.setName("jPanel14"); // NOI18N
        jPanel14.setLayout(new java.awt.BorderLayout());

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N
        jPanel14.add(jLabel12, java.awt.BorderLayout.CENTER);

        jPanel8.add(jPanel14);

        jPanel15.setName("jPanel15"); // NOI18N
        jPanel15.setLayout(new java.awt.BorderLayout());

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N
        jPanel15.add(jLabel5, java.awt.BorderLayout.CENTER);

        jPanel8.add(jPanel15);

        jPanel7.add(jPanel8, java.awt.BorderLayout.LINE_START);

        jPanel9.setName("jPanel9"); // NOI18N
        jPanel9.setPreferredSize(new java.awt.Dimension(300, 220));
        jPanel9.setLayout(new java.awt.GridLayout(7, 1, 4, 4));

        jPanel16.setName("jPanel16"); // NOI18N
        jPanel16.setLayout(new java.awt.BorderLayout());

        jTextFieldbillname.setText(resourceMap.getString("jTextFieldbillname.text")); // NOI18N
        jTextFieldbillname.setName("jTextFieldbillname"); // NOI18N
        jPanel16.add(jTextFieldbillname, java.awt.BorderLayout.CENTER);

        jPanel9.add(jPanel16);

        jPanel17.setName("jPanel17"); // NOI18N
        jPanel17.setLayout(new java.awt.BorderLayout());

        jComboBoxcustomername.setName("jComboBoxcustomername"); // NOI18N
        jPanel17.add(jComboBoxcustomername, java.awt.BorderLayout.CENTER);

        jPanel9.add(jPanel17);

        jPanel18.setName("jPanel18"); // NOI18N
        jPanel18.setLayout(new java.awt.BorderLayout());

        jComboBoxaccount.setName("jComboBoxaccount"); // NOI18N
        jPanel18.add(jComboBoxaccount, java.awt.BorderLayout.CENTER);

        jPanel9.add(jPanel18);

        jPanel19.setName("jPanel19"); // NOI18N
        jPanel19.setLayout(new java.awt.BorderLayout());

        jCalendarCombobuilddate.setName("jCalendarCombobuilddate"); // NOI18N
        jCalendarCombobuilddate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCalendarCombobuilddateActionPerformed(evt);
            }
        });
        jPanel19.add(jCalendarCombobuilddate, java.awt.BorderLayout.LINE_START);

        jPanel9.add(jPanel19);

        jPanel20.setName("jPanel20"); // NOI18N
        jPanel20.setLayout(new java.awt.BorderLayout());

        jPanel89.setName("jPanel89"); // NOI18N
        jPanel89.setPreferredSize(new java.awt.Dimension(80, 24));
        jPanel89.setLayout(new java.awt.BorderLayout());

        jComboBoxst.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "a", "b" }));
        jComboBoxst.setName("jComboBoxst"); // NOI18N
        jPanel89.add(jComboBoxst, java.awt.BorderLayout.CENTER);

        jPanel20.add(jPanel89, java.awt.BorderLayout.LINE_START);

        jPanel90.setName("jPanel90"); // NOI18N
        jPanel90.setLayout(new java.awt.BorderLayout());

        jPanel91.setName("jPanel91"); // NOI18N
        jPanel91.setPreferredSize(new java.awt.Dimension(50, 50));
        jPanel91.setLayout(new java.awt.BorderLayout());

        jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N
        jPanel91.add(jLabel13, java.awt.BorderLayout.CENTER);

        jPanel90.add(jPanel91, java.awt.BorderLayout.LINE_START);

        jPanel92.setName("jPanel92"); // NOI18N
        jPanel92.setPreferredSize(new java.awt.Dimension(100, 24));
        jPanel92.setLayout(new java.awt.BorderLayout());

        jComboBoxunit.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "USD", "VND" }));
        jComboBoxunit.setName("jComboBoxunit"); // NOI18N
        jPanel92.add(jComboBoxunit, java.awt.BorderLayout.CENTER);

        jPanel90.add(jPanel92, java.awt.BorderLayout.LINE_END);

        jPanel20.add(jPanel90, java.awt.BorderLayout.CENTER);

        jPanel9.add(jPanel20);

        jPanel88.setName("jPanel88"); // NOI18N
        jPanel88.setLayout(new java.awt.BorderLayout());

        jComboBoxProductname.setToolTipText(resourceMap.getString("jComboBoxProductname.toolTipText")); // NOI18N
        jComboBoxProductname.setName("jComboBoxProductname"); // NOI18N
        jComboBoxProductname.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jComboBoxProductnameMouseClicked(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jComboBoxProductnameMousePressed(evt);
            }
        });
        jComboBoxProductname.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxProductnameActionPerformed(evt);
            }
        });
        jPanel88.add(jComboBoxProductname, java.awt.BorderLayout.CENTER);

        jPanel9.add(jPanel88);

        jPanel21.setName("jPanel21"); // NOI18N
        jPanel21.setLayout(new java.awt.BorderLayout());

        jPanel22.setName("jPanel22"); // NOI18N
        jPanel22.setPreferredSize(new java.awt.Dimension(56, 28));
        jPanel22.setLayout(new java.awt.BorderLayout());

        jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
        jButton4.setName("jButton4"); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        jPanel22.add(jButton4, java.awt.BorderLayout.CENTER);

        jPanel21.add(jPanel22, java.awt.BorderLayout.LINE_START);

        jPanel23.setName("jPanel23"); // NOI18N
        jPanel23.setLayout(new java.awt.BorderLayout());

        jPanel24.setName("jPanel24"); // NOI18N
        jPanel24.setPreferredSize(new java.awt.Dimension(55, 28));
        jPanel24.setLayout(new java.awt.BorderLayout());

        jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
        jButton3.setName("jButton3"); // NOI18N
        jPanel24.add(jButton3, java.awt.BorderLayout.CENTER);

        jPanel23.add(jPanel24, java.awt.BorderLayout.LINE_START);

        jPanel25.setName("jPanel25"); // NOI18N
        jPanel25.setLayout(new java.awt.BorderLayout());

        jPanel26.setName("jPanel26"); // NOI18N
        jPanel26.setPreferredSize(new java.awt.Dimension(63, 28));
        jPanel26.setLayout(new java.awt.BorderLayout());

        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N
        jPanel26.add(jButton2, java.awt.BorderLayout.CENTER);

        jPanel25.add(jPanel26, java.awt.BorderLayout.LINE_START);

        jPanel27.setName("jPanel27"); // NOI18N
        jPanel27.setLayout(new java.awt.BorderLayout());

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jPanel27.add(jButton1, java.awt.BorderLayout.CENTER);

        jPanel25.add(jPanel27, java.awt.BorderLayout.CENTER);

        jPanel23.add(jPanel25, java.awt.BorderLayout.CENTER);

        jPanel21.add(jPanel23, java.awt.BorderLayout.CENTER);

        jPanel9.add(jPanel21);

        jPanel7.add(jPanel9, java.awt.BorderLayout.CENTER);

        jPanel3.add(jPanel7, java.awt.BorderLayout.CENTER);

        jPanel1.add(jPanel3);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(resourceMap.getColor("jPanel4.border.border.lineColor"), 2), resourceMap.getString("jPanel4.border.title"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N
        jPanel4.setLayout(new java.awt.BorderLayout());

        jPanel64.setName("jPanel64"); // NOI18N
        jPanel64.setPreferredSize(new java.awt.Dimension(942, 30));
        jPanel64.setLayout(new java.awt.BorderLayout());

        jPanel66.setName("jPanel66"); // NOI18N
        jPanel66.setPreferredSize(new java.awt.Dimension(250, 30));

        javax.swing.GroupLayout jPanel66Layout = new javax.swing.GroupLayout(jPanel66);
        jPanel66.setLayout(jPanel66Layout);
        jPanel66Layout.setHorizontalGroup(
            jPanel66Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 250, Short.MAX_VALUE)
        );
        jPanel66Layout.setVerticalGroup(
            jPanel66Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 30, Short.MAX_VALUE)
        );

        jPanel64.add(jPanel66, java.awt.BorderLayout.LINE_START);

        jPanel67.setName("jPanel67"); // NOI18N
        jPanel67.setPreferredSize(new java.awt.Dimension(252, 30));
        jPanel67.setLayout(new java.awt.BorderLayout());

        jPanel74.setName("jPanel74"); // NOI18N
        jPanel74.setPreferredSize(new java.awt.Dimension(50, 30));
        jPanel74.setLayout(new java.awt.BorderLayout());

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N
        jPanel74.add(jLabel10, java.awt.BorderLayout.CENTER);

        jPanel67.add(jPanel74, java.awt.BorderLayout.LINE_END);

        jPanel64.add(jPanel67, java.awt.BorderLayout.LINE_END);

        jPanel68.setName("jPanel68"); // NOI18N
        jPanel68.setLayout(new java.awt.BorderLayout());

        jPanel69.setName("jPanel69"); // NOI18N
        jPanel69.setPreferredSize(new java.awt.Dimension(110, 30));
        jPanel69.setLayout(new java.awt.BorderLayout());

        jButton6.setText(resourceMap.getString("jButton6.text")); // NOI18N
        jButton6.setName("jButton6"); // NOI18N
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        jPanel69.add(jButton6, java.awt.BorderLayout.CENTER);

        jPanel68.add(jPanel69, java.awt.BorderLayout.LINE_START);

        jPanel70.setName("jPanel70"); // NOI18N
        jPanel70.setPreferredSize(new java.awt.Dimension(110, 30));
        jPanel70.setLayout(new java.awt.BorderLayout());

        jButton8.setText(resourceMap.getString("jButton8.text")); // NOI18N
        jButton8.setName("jButton8"); // NOI18N
        jPanel70.add(jButton8, java.awt.BorderLayout.CENTER);

        jPanel68.add(jPanel70, java.awt.BorderLayout.LINE_END);

        jPanel71.setName("jPanel71"); // NOI18N
        jPanel71.setLayout(new java.awt.BorderLayout());

        jPanel72.setName("jPanel72"); // NOI18N
        jPanel72.setPreferredSize(new java.awt.Dimension(110, 30));
        jPanel72.setLayout(new java.awt.BorderLayout());

        jButton7.setText(resourceMap.getString("jButton7.text")); // NOI18N
        jButton7.setName("jButton7"); // NOI18N
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        jPanel72.add(jButton7, java.awt.BorderLayout.CENTER);

        jPanel71.add(jPanel72, java.awt.BorderLayout.LINE_START);

        jPanel73.setName("jPanel73"); // NOI18N
        jPanel73.setLayout(new java.awt.BorderLayout());

        jTextField6.setText(resourceMap.getString("jTextField6.text")); // NOI18N
        jTextField6.setName("jTextField6"); // NOI18N
        jPanel73.add(jTextField6, java.awt.BorderLayout.CENTER);

        jPanel71.add(jPanel73, java.awt.BorderLayout.CENTER);

        jPanel68.add(jPanel71, java.awt.BorderLayout.CENTER);

        jPanel64.add(jPanel68, java.awt.BorderLayout.CENTER);

        jPanel4.add(jPanel64, java.awt.BorderLayout.PAGE_END);

        jPanel65.setName("jPanel65"); // NOI18N
        jPanel65.setLayout(new java.awt.BorderLayout());

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTablecontent.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTablecontent.setName("jTablecontent"); // NOI18N
        jTablecontent.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTablecontentMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTablecontent);

        jPanel65.add(jScrollPane1, java.awt.BorderLayout.CENTER);

        jPanel4.add(jPanel65, java.awt.BorderLayout.CENTER);

        jPanel1.add(jPanel4);

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel2.setName("jPanel2"); // NOI18N
        jPanel2.setLayout(new java.awt.GridLayout(2, 1, 3, 3));

        jPanel33.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(resourceMap.getColor("jPanel33.border.border.lineColor"), 3))); // NOI18N
        jPanel33.setName("jPanel33"); // NOI18N
        jPanel33.setLayout(new java.awt.BorderLayout());

        jPanel35.setName("jPanel35"); // NOI18N
        jPanel35.setPreferredSize(new java.awt.Dimension(250, 202));

        javax.swing.GroupLayout jPanel35Layout = new javax.swing.GroupLayout(jPanel35);
        jPanel35.setLayout(jPanel35Layout);
        jPanel35Layout.setHorizontalGroup(
            jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 250, Short.MAX_VALUE)
        );
        jPanel35Layout.setVerticalGroup(
            jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 212, Short.MAX_VALUE)
        );

        jPanel33.add(jPanel35, java.awt.BorderLayout.LINE_START);

        jPanel36.setName("jPanel36"); // NOI18N
        jPanel36.setPreferredSize(new java.awt.Dimension(250, 202));

        javax.swing.GroupLayout jPanel36Layout = new javax.swing.GroupLayout(jPanel36);
        jPanel36.setLayout(jPanel36Layout);
        jPanel36Layout.setHorizontalGroup(
            jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 250, Short.MAX_VALUE)
        );
        jPanel36Layout.setVerticalGroup(
            jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 212, Short.MAX_VALUE)
        );

        jPanel33.add(jPanel36, java.awt.BorderLayout.LINE_END);

        jPanel37.setName("jPanel37"); // NOI18N
        jPanel37.setLayout(new java.awt.BorderLayout());

        jPanel28.setName("jPanel28"); // NOI18N
        jPanel28.setLayout(new java.awt.GridLayout(8, 1, 4, 4));

        jPanel31.setName("jPanel31"); // NOI18N

        javax.swing.GroupLayout jPanel31Layout = new javax.swing.GroupLayout(jPanel31);
        jPanel31.setLayout(jPanel31Layout);
        jPanel31Layout.setHorizontalGroup(
            jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel31Layout.setVerticalGroup(
            jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel28.add(jPanel31);

        jPanel32.setName("jPanel32"); // NOI18N

        javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32);
        jPanel32.setLayout(jPanel32Layout);
        jPanel32Layout.setHorizontalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel32Layout.setVerticalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel28.add(jPanel32);

        jPanel38.setName("jPanel38"); // NOI18N
        jPanel38.setLayout(new java.awt.BorderLayout());

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N
        jPanel38.add(jLabel7, java.awt.BorderLayout.CENTER);

        jPanel28.add(jPanel38);

        jPanel39.setName("jPanel39"); // NOI18N
        jPanel39.setLayout(new java.awt.BorderLayout());

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N
        jPanel39.add(jLabel8, java.awt.BorderLayout.CENTER);

        jPanel28.add(jPanel39);

        jPanel40.setName("jPanel40"); // NOI18N
        jPanel40.setLayout(new java.awt.BorderLayout());

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N
        jPanel40.add(jLabel9, java.awt.BorderLayout.CENTER);

        jPanel28.add(jPanel40);

        jPanel41.setName("jPanel41"); // NOI18N

        javax.swing.GroupLayout jPanel41Layout = new javax.swing.GroupLayout(jPanel41);
        jPanel41.setLayout(jPanel41Layout);
        jPanel41Layout.setHorizontalGroup(
            jPanel41Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel41Layout.setVerticalGroup(
            jPanel41Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel28.add(jPanel41);

        jPanel42.setName("jPanel42"); // NOI18N

        javax.swing.GroupLayout jPanel42Layout = new javax.swing.GroupLayout(jPanel42);
        jPanel42.setLayout(jPanel42Layout);
        jPanel42Layout.setHorizontalGroup(
            jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel42Layout.setVerticalGroup(
            jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel28.add(jPanel42);

        jPanel43.setName("jPanel43"); // NOI18N

        javax.swing.GroupLayout jPanel43Layout = new javax.swing.GroupLayout(jPanel43);
        jPanel43.setLayout(jPanel43Layout);
        jPanel43Layout.setHorizontalGroup(
            jPanel43Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel43Layout.setVerticalGroup(
            jPanel43Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel28.add(jPanel43);

        jPanel37.add(jPanel28, java.awt.BorderLayout.LINE_START);

        jPanel29.setName("jPanel29"); // NOI18N
        jPanel29.setLayout(new java.awt.GridLayout(8, 1, 4, 4));

        jPanel52.setName("jPanel52"); // NOI18N

        javax.swing.GroupLayout jPanel52Layout = new javax.swing.GroupLayout(jPanel52);
        jPanel52.setLayout(jPanel52Layout);
        jPanel52Layout.setHorizontalGroup(
            jPanel52Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 137, Short.MAX_VALUE)
        );
        jPanel52Layout.setVerticalGroup(
            jPanel52Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel29.add(jPanel52);

        jPanel53.setName("jPanel53"); // NOI18N

        javax.swing.GroupLayout jPanel53Layout = new javax.swing.GroupLayout(jPanel53);
        jPanel53.setLayout(jPanel53Layout);
        jPanel53Layout.setHorizontalGroup(
            jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 137, Short.MAX_VALUE)
        );
        jPanel53Layout.setVerticalGroup(
            jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel29.add(jPanel53);

        jPanel54.setName("jPanel54"); // NOI18N
        jPanel54.setLayout(new java.awt.BorderLayout());

        jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N
        jCheckBox1.setName("jCheckBox1"); // NOI18N
        jPanel54.add(jCheckBox1, java.awt.BorderLayout.CENTER);

        jPanel29.add(jPanel54);

        jPanel55.setName("jPanel55"); // NOI18N
        jPanel55.setLayout(new java.awt.BorderLayout());

        jCheckBox2.setText(resourceMap.getString("jCheckBox2.text")); // NOI18N
        jCheckBox2.setName("jCheckBox2"); // NOI18N
        jPanel55.add(jCheckBox2, java.awt.BorderLayout.CENTER);

        jPanel29.add(jPanel55);

        jPanel56.setName("jPanel56"); // NOI18N
        jPanel56.setLayout(new java.awt.BorderLayout());

        jCheckBox3.setText(resourceMap.getString("jCheckBox3.text")); // NOI18N
        jCheckBox3.setName("jCheckBox3"); // NOI18N
        jPanel56.add(jCheckBox3, java.awt.BorderLayout.CENTER);

        jPanel29.add(jPanel56);

        jPanel57.setName("jPanel57"); // NOI18N

        javax.swing.GroupLayout jPanel57Layout = new javax.swing.GroupLayout(jPanel57);
        jPanel57.setLayout(jPanel57Layout);
        jPanel57Layout.setHorizontalGroup(
            jPanel57Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 137, Short.MAX_VALUE)
        );
        jPanel57Layout.setVerticalGroup(
            jPanel57Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel29.add(jPanel57);

        jPanel58.setName("jPanel58"); // NOI18N

        javax.swing.GroupLayout jPanel58Layout = new javax.swing.GroupLayout(jPanel58);
        jPanel58.setLayout(jPanel58Layout);
        jPanel58Layout.setHorizontalGroup(
            jPanel58Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 137, Short.MAX_VALUE)
        );
        jPanel58Layout.setVerticalGroup(
            jPanel58Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel29.add(jPanel58);

        jPanel59.setName("jPanel59"); // NOI18N

        javax.swing.GroupLayout jPanel59Layout = new javax.swing.GroupLayout(jPanel59);
        jPanel59.setLayout(jPanel59Layout);
        jPanel59Layout.setHorizontalGroup(
            jPanel59Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 137, Short.MAX_VALUE)
        );
        jPanel59Layout.setVerticalGroup(
            jPanel59Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel29.add(jPanel59);

        jPanel37.add(jPanel29, java.awt.BorderLayout.LINE_END);

        jPanel30.setName("jPanel30"); // NOI18N
        jPanel30.setLayout(new java.awt.GridLayout(8, 1, 4, 4));

        jPanel44.setName("jPanel44"); // NOI18N
        jPanel44.setLayout(new java.awt.BorderLayout());

        jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
        jLabel6.setForeground(resourceMap.getColor("jLabel6.foreground")); // NOI18N
        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N
        jPanel44.add(jLabel6, java.awt.BorderLayout.CENTER);

        jPanel30.add(jPanel44);

        jPanel45.setName("jPanel45"); // NOI18N

        javax.swing.GroupLayout jPanel45Layout = new javax.swing.GroupLayout(jPanel45);
        jPanel45.setLayout(jPanel45Layout);
        jPanel45Layout.setHorizontalGroup(
            jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 203, Short.MAX_VALUE)
        );
        jPanel45Layout.setVerticalGroup(
            jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel30.add(jPanel45);

        jPanel46.setName("jPanel46"); // NOI18N
        jPanel46.setLayout(new java.awt.BorderLayout());

        jTextField4.setText(resourceMap.getString("jTextField4.text")); // NOI18N
        jTextField4.setName("jTextField4"); // NOI18N
        jPanel46.add(jTextField4, java.awt.BorderLayout.CENTER);

        jPanel30.add(jPanel46);

        jPanel47.setName("jPanel47"); // NOI18N
        jPanel47.setLayout(new java.awt.BorderLayout());

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox2.setName("jComboBox2"); // NOI18N
        jPanel47.add(jComboBox2, java.awt.BorderLayout.CENTER);

        jPanel30.add(jPanel47);

        jPanel48.setName("jPanel48"); // NOI18N
        jPanel48.setLayout(new java.awt.BorderLayout());
        jPanel30.add(jPanel48);

        jPanel49.setName("jPanel49"); // NOI18N
        jPanel49.setLayout(new java.awt.BorderLayout());

        jPanel60.setName("jPanel60"); // NOI18N
        jPanel60.setPreferredSize(new java.awt.Dimension(67, 23));

        javax.swing.GroupLayout jPanel60Layout = new javax.swing.GroupLayout(jPanel60);
        jPanel60.setLayout(jPanel60Layout);
        jPanel60Layout.setHorizontalGroup(
            jPanel60Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 67, Short.MAX_VALUE)
        );
        jPanel60Layout.setVerticalGroup(
            jPanel60Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel49.add(jPanel60, java.awt.BorderLayout.LINE_START);

        jPanel61.setName("jPanel61"); // NOI18N
        jPanel61.setLayout(new java.awt.BorderLayout());

        jPanel62.setName("jPanel62"); // NOI18N
        jPanel62.setPreferredSize(new java.awt.Dimension(67, 23));
        jPanel62.setLayout(new java.awt.BorderLayout());

        jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N
        jButton5.setName("jButton5"); // NOI18N
        jPanel62.add(jButton5, java.awt.BorderLayout.CENTER);

        jPanel61.add(jPanel62, java.awt.BorderLayout.LINE_START);

        jPanel63.setName("jPanel63"); // NOI18N
        jPanel63.setPreferredSize(new java.awt.Dimension(67, 23));

        javax.swing.GroupLayout jPanel63Layout = new javax.swing.GroupLayout(jPanel63);
        jPanel63.setLayout(jPanel63Layout);
        jPanel63Layout.setHorizontalGroup(
            jPanel63Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 67, Short.MAX_VALUE)
        );
        jPanel63Layout.setVerticalGroup(
            jPanel63Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel61.add(jPanel63, java.awt.BorderLayout.LINE_END);

        jPanel49.add(jPanel61, java.awt.BorderLayout.CENTER);

        jPanel30.add(jPanel49);

        jPanel50.setName("jPanel50"); // NOI18N

        javax.swing.GroupLayout jPanel50Layout = new javax.swing.GroupLayout(jPanel50);
        jPanel50.setLayout(jPanel50Layout);
        jPanel50Layout.setHorizontalGroup(
            jPanel50Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 203, Short.MAX_VALUE)
        );
        jPanel50Layout.setVerticalGroup(
            jPanel50Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel30.add(jPanel50);

        jPanel51.setName("jPanel51"); // NOI18N

        javax.swing.GroupLayout jPanel51Layout = new javax.swing.GroupLayout(jPanel51);
        jPanel51.setLayout(jPanel51Layout);
        jPanel51Layout.setHorizontalGroup(
            jPanel51Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 203, Short.MAX_VALUE)
        );
        jPanel51Layout.setVerticalGroup(
            jPanel51Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jPanel30.add(jPanel51);

        jPanel37.add(jPanel30, java.awt.BorderLayout.CENTER);

        jPanel33.add(jPanel37, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel33);

        jPanel34.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(resourceMap.getColor("jPanel34.border.border.lineColor"), 3), resourceMap.getString("jPanel34.border.title"))); // NOI18N
        jPanel34.setName("jPanel34"); // NOI18N
        jPanel34.setLayout(new java.awt.BorderLayout());

        jPanel77.setName("jPanel77"); // NOI18N
        jPanel77.setPreferredSize(new java.awt.Dimension(940, 30));
        jPanel77.setLayout(new java.awt.BorderLayout());

        jPanel79.setName("jPanel79"); // NOI18N
        jPanel79.setPreferredSize(new java.awt.Dimension(250, 30));

        javax.swing.GroupLayout jPanel79Layout = new javax.swing.GroupLayout(jPanel79);
        jPanel79.setLayout(jPanel79Layout);
        jPanel79Layout.setHorizontalGroup(
            jPanel79Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 250, Short.MAX_VALUE)
        );
        jPanel79Layout.setVerticalGroup(
            jPanel79Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 30, Short.MAX_VALUE)
        );

        jPanel77.add(jPanel79, java.awt.BorderLayout.LINE_START);

        jPanel80.setName("jPanel80"); // NOI18N
        jPanel80.setPreferredSize(new java.awt.Dimension(250, 30));
        jPanel80.setLayout(new java.awt.BorderLayout());

        jPanel87.setName("jPanel87"); // NOI18N
        jPanel87.setPreferredSize(new java.awt.Dimension(50, 30));
        jPanel87.setLayout(new java.awt.BorderLayout());

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N
        jPanel87.add(jLabel11, java.awt.BorderLayout.CENTER);

        jPanel80.add(jPanel87, java.awt.BorderLayout.LINE_END);

        jPanel77.add(jPanel80, java.awt.BorderLayout.LINE_END);

        jPanel81.setName("jPanel81"); // NOI18N
        jPanel81.setLayout(new java.awt.BorderLayout());

        jPanel82.setName("jPanel82"); // NOI18N
        jPanel82.setPreferredSize(new java.awt.Dimension(110, 30));
        jPanel82.setLayout(new java.awt.BorderLayout());

        jButton9.setText(resourceMap.getString("jButton9.text")); // NOI18N
        jButton9.setName("jButton9"); // NOI18N
        jPanel82.add(jButton9, java.awt.BorderLayout.CENTER);

        jPanel81.add(jPanel82, java.awt.BorderLayout.LINE_START);

        jPanel83.setName("jPanel83"); // NOI18N
        jPanel83.setPreferredSize(new java.awt.Dimension(110, 30));
        jPanel83.setLayout(new java.awt.BorderLayout());

        jButton11.setText(resourceMap.getString("jButton11.text")); // NOI18N
        jButton11.setName("jButton11"); // NOI18N
        jPanel83.add(jButton11, java.awt.BorderLayout.CENTER);

        jPanel81.add(jPanel83, java.awt.BorderLayout.LINE_END);

        jPanel84.setName("jPanel84"); // NOI18N
        jPanel84.setLayout(new java.awt.BorderLayout());

        jPanel85.setName("jPanel85"); // NOI18N
        jPanel85.setPreferredSize(new java.awt.Dimension(110, 30));
        jPanel85.setLayout(new java.awt.BorderLayout());

        jButton10.setText(resourceMap.getString("jButton10.text")); // NOI18N
        jButton10.setName("jButton10"); // NOI18N
        jPanel85.add(jButton10, java.awt.BorderLayout.CENTER);

        jPanel84.add(jPanel85, java.awt.BorderLayout.LINE_START);

        jPanel86.setName("jPanel86"); // NOI18N
        jPanel86.setLayout(new java.awt.BorderLayout());

        jTextField7.setText(resourceMap.getString("jTextField7.text")); // NOI18N
        jTextField7.setName("jTextField7"); // NOI18N
        jPanel86.add(jTextField7, java.awt.BorderLayout.CENTER);

        jPanel84.add(jPanel86, java.awt.BorderLayout.CENTER);

        jPanel81.add(jPanel84, java.awt.BorderLayout.CENTER);

        jPanel77.add(jPanel81, java.awt.BorderLayout.CENTER);

        jPanel34.add(jPanel77, java.awt.BorderLayout.PAGE_END);

        jPanel78.setName("jPanel78"); // NOI18N
        jPanel78.setLayout(new java.awt.BorderLayout());

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable2.setName("jTable2"); // NOI18N
        jScrollPane2.setViewportView(jTable2);

        jPanel78.add(jScrollPane2, java.awt.BorderLayout.CENTER);

        jPanel34.add(jPanel78, java.awt.BorderLayout.CENTER);

        jPanel2.add(jPanel34);

        jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

        getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    private void jTablecontentMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTablecontentMouseClicked
        
        Tableinformation();
//        Medium.dtsb.setVisible(false);
        jPaneldetail.removeAll();
       JInternalFrameeditdetailsalesbill jf=new JInternalFrameeditdetailsalesbill();
        this.jPaneldetail.add(jf);
        jf.setVisible(true);
        //Medium.edtsb=new JInternalFrameeditdetailsalesbill();
         Medium.edtsb.Createdetailsalesbill();
         //Medium.edtsb.drt();
        
}//GEN-LAST:event_jTablecontentMouseClicked
        int i=8;
        int j=0;
    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
       SalesBill sb=new SalesBill();
        //System.out.println(sb.geti());
       if(i<sb.geti())
       {
       Creattabledatabase1(i);
        i=i+4;
        j=j+4;
       }
     // System.out.println("i la:"+i);
          else
       {
           
           //j=j-4;
           i=i-4;
          Creattabledatabase2(i);
          
          jButton6.setEnabled(false);
          }
}//GEN-LAST:event_jButton6ActionPerformed

    private void jComboBoxProductnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxProductnameActionPerformed
        jPaneldetail.removeAll();
        JInternalFrameDetailsalesbill jf=new JInternalFrameDetailsalesbill();
        this.jPaneldetail.add(jf);
        jf.setVisible(true);
    }//GEN-LAST:event_jComboBoxProductnameActionPerformed

    private void jComboBoxProductnameMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxProductnameMousePressed
        
}//GEN-LAST:event_jComboBoxProductnameMousePressed

    private void jComboBoxProductnameMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxProductnameMouseClicked
        
}//GEN-LAST:event_jComboBoxProductnameMouseClicked

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        Adsalesbill();
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
       // j=j-4; 
       Creattabledatabasepr(j);
       
//        jButton6.setEnabled(true);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jCalendarCombobuilddateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCalendarCombobuilddateActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCalendarCombobuilddateActionPerformed
    public void Adsalesbill()
    {
        try {
            SalesBill sb=new SalesBill();
            sb.setBillName(this.jTextFieldbillname.getText());
            int customerid=ctl.get(jComboBoxcustomername.getSelectedIndex()).getCustomerid() ;
            sb.setCustomerId(customerid);
            int accountid=adl.get(jComboBoxaccount.getSelectedIndex()).getAccountid();
            sb.setAccountId(accountid);
            
            //SimpleDateFormat sp=new SimpleDateFormat("MM-dd-yyyy");
            //String date=jCalendarCombobuilddate.getDate();
            sb.setBuildDate(jCalendarCombobuilddate.getDate());
            
            sb.setState(jComboBoxst.getSelectedItem().toString());
            sb.setUnit(jComboBoxunit.getSelectedItem().toString());
            sb.setTotalCost(0);
            if(sb.Addsalesbill()) 
            {
                JOptionPane.showMessageDialog(null, "thanh cong");
            } else {
                JOptionPane.showMessageDialog(null, "that bai");
            }
            
        }
        
        catch(Exception ex) {
            System.out.println(ex);
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private org.freixas.jcalendar.JCalendarCombo jCalendarCombobuilddate;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JCheckBox jCheckBox3;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBoxProductname;
    private javax.swing.JComboBox jComboBoxaccount;
    private javax.swing.JComboBox jComboBoxcustomername;
    private javax.swing.JComboBox jComboBoxst;
    private javax.swing.JComboBox jComboBoxunit;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel23;
    private javax.swing.JPanel jPanel24;
    private javax.swing.JPanel jPanel25;
    private javax.swing.JPanel jPanel26;
    private javax.swing.JPanel jPanel27;
    private javax.swing.JPanel jPanel28;
    private javax.swing.JPanel jPanel29;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel30;
    private javax.swing.JPanel jPanel31;
    private javax.swing.JPanel jPanel32;
    private javax.swing.JPanel jPanel33;
    private javax.swing.JPanel jPanel34;
    private javax.swing.JPanel jPanel35;
    private javax.swing.JPanel jPanel36;
    private javax.swing.JPanel jPanel37;
    private javax.swing.JPanel jPanel38;
    private javax.swing.JPanel jPanel39;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel40;
    private javax.swing.JPanel jPanel41;
    private javax.swing.JPanel jPanel42;
    private javax.swing.JPanel jPanel43;
    private javax.swing.JPanel jPanel44;
    private javax.swing.JPanel jPanel45;
    private javax.swing.JPanel jPanel46;
    private javax.swing.JPanel jPanel47;
    private javax.swing.JPanel jPanel48;
    private javax.swing.JPanel jPanel49;
    private javax.swing.JPanel jPanel50;
    private javax.swing.JPanel jPanel51;
    private javax.swing.JPanel jPanel52;
    private javax.swing.JPanel jPanel53;
    private javax.swing.JPanel jPanel54;
    private javax.swing.JPanel jPanel55;
    private javax.swing.JPanel jPanel56;
    private javax.swing.JPanel jPanel57;
    private javax.swing.JPanel jPanel58;
    private javax.swing.JPanel jPanel59;
    private javax.swing.JPanel jPanel60;
    private javax.swing.JPanel jPanel61;
    private javax.swing.JPanel jPanel62;
    private javax.swing.JPanel jPanel63;
    private javax.swing.JPanel jPanel64;
    private javax.swing.JPanel jPanel65;
    private javax.swing.JPanel jPanel66;
    private javax.swing.JPanel jPanel67;
    private javax.swing.JPanel jPanel68;
    private javax.swing.JPanel jPanel69;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel70;
    private javax.swing.JPanel jPanel71;
    private javax.swing.JPanel jPanel72;
    private javax.swing.JPanel jPanel73;
    private javax.swing.JPanel jPanel74;
    private javax.swing.JPanel jPanel75;
    private javax.swing.JPanel jPanel76;
    private javax.swing.JPanel jPanel77;
    private javax.swing.JPanel jPanel78;
    private javax.swing.JPanel jPanel79;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel80;
    private javax.swing.JPanel jPanel81;
    private javax.swing.JPanel jPanel82;
    private javax.swing.JPanel jPanel83;
    private javax.swing.JPanel jPanel84;
    private javax.swing.JPanel jPanel85;
    private javax.swing.JPanel jPanel86;
    private javax.swing.JPanel jPanel87;
    private javax.swing.JPanel jPanel88;
    private javax.swing.JPanel jPanel89;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPanel jPanel90;
    private javax.swing.JPanel jPanel91;
    private javax.swing.JPanel jPanel92;
    private javax.swing.JPanel jPaneldetail;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTablecontent;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextFieldbillname;
    // End of variables declaration//GEN-END:variables
}
